import pygame
from Bullet import * # 子弹
from BasePlane import * # 飞机基类

'''飞机'''
class HeroPlane(BasePlane):
  def __init__(self, screen):
    #BasePlane.__init__(self, screen, 210, 700, pygame.image.load('src/assets/images/hero1.png'))
    # super() 这个不用写 self
    super().__init__(screen, 210, 700, 'src/assets/images/hero1.png')

  # def display(self):
  #   self.screen.blit(self.image, (self.x, self.y))
  #   for bullet in self.bulletList:
  #     bullet.display()
  #     bullet.move()
  #     if bullet.judge(): # 判断子弹是否越界
  #       self.bulletList.remove(bullet)

  def moveLeft(self):
    self.x -= 5
  def moveRight(self):
    self.x += 5
  def moveUp(self):
    self.y -= 5
  def moveDown(self):
    self.y += 5

  def fire(self):
    self.bulletList.append(Bullet(self.screen, self))